import api from '../../utils/api';

Page({

  data: {
    articleDetail: {}
  },

  onLoad: function (options) {
    const { id, title } = options;
    wx.setNavigationBarTitle({
      title
    });
    this.getArticleDetail(id);
  },

  getArticleDetail(id) {
    const _this = this;
    wx.showLoading({
      title: '请稍后...'
    });
    api({
      url: '/User/queryArticle',
      method: 'POST',
      data: {
        id
      },
      success: function (res) {
        wx.hideLoading();
        _this.setData({
          articleDetail: res.data.data
        });
      }
    });
  }
});